<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RDoc::Markup::Formatter - rdoc: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-gen_relative_url">::gen_relative_url</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-accept_document">#accept_document</a>
    <li ><a href="#method-i-add_regexp_handling_RDOCLINK">#add_regexp_handling_RDOCLINK</a>
    <li ><a href="#method-i-add_regexp_handling_TIDYLINK">#add_regexp_handling_TIDYLINK</a>
    <li ><a href="#method-i-add_tag">#add_tag</a>
    <li ><a href="#method-i-annotate">#annotate</a>
    <li ><a href="#method-i-convert">#convert</a>
    <li ><a href="#method-i-convert_flow">#convert_flow</a>
    <li ><a href="#method-i-convert_regexp_handling">#convert_regexp_handling</a>
    <li ><a href="#method-i-convert_string">#convert_string</a>
    <li ><a href="#method-i-ignore">#ignore</a>
    <li ><a href="#method-i-in_tt-3F">#in_tt?</a>
    <li ><a href="#method-i-off_tags">#off_tags</a>
    <li ><a href="#method-i-on_tags">#on_tags</a>
    <li ><a href="#method-i-parse_url">#parse_url</a>
    <li ><a href="#method-i-tt-3F">#tt?</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RDoc::Markup::Formatter">
    <h1 id="class-RDoc::Markup::Formatter" class="class">
      class RDoc::Markup::Formatter
    </h1>

    <section class="description">
    
<p>Base class for <a href="../../RDoc.html"><code>RDoc</code></a> markup formatters</p>

<p>Formatters are a visitor that converts an <a href="../Markup.html"><code>RDoc::Markup</code></a> tree (from a comment) into some kind of output.  <a href="../../RDoc.html"><code>RDoc</code></a> ships with formatters for converting back to rdoc, ANSI text, HTML, a Table of Contents and other formats.</p>

<p>If you’d like to write your own <a href="Formatter.html"><code>Formatter</code></a> use RDoc::Markup::FormatterTestCase.  If you’re writing a text-output formatter use RDoc::Markup::TextFormatterTestCase which provides extra test cases.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="InlineTag">InlineTag
          <dd><p>Tag for inline markup containing a <code>bit</code> for the bitmask and the <code>on</code> and <code>off</code> triggers.</p>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-gen_relative_url" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gen_relative_url</span><span
                                class="method-args">(path, target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Converts a target url to one that is relative to a given path</p>

                              <div class="method-source-code" id="gen_relative_url-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 24</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">gen_relative_url</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">target</span>
  <span class="ruby-identifier">from</span>        = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span> <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">to</span>, <span class="ruby-identifier">to_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">split</span> <span class="ruby-identifier">target</span>

  <span class="ruby-identifier">from</span> = <span class="ruby-identifier">from</span>.<span class="ruby-identifier">split</span> <span class="ruby-string">&quot;/&quot;</span>
  <span class="ruby-identifier">to</span>   = <span class="ruby-identifier">to</span>.<span class="ruby-identifier">split</span> <span class="ruby-string">&quot;/&quot;</span>

  <span class="ruby-identifier">from</span>.<span class="ruby-identifier">delete</span> <span class="ruby-string">&#39;.&#39;</span>
  <span class="ruby-identifier">to</span>.<span class="ruby-identifier">delete</span> <span class="ruby-string">&#39;.&#39;</span>

  <span class="ruby-keyword">while</span> <span class="ruby-identifier">from</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">to</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">from</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">to</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">from</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">to</span>.<span class="ruby-identifier">shift</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">from</span>.<span class="ruby-identifier">fill</span> <span class="ruby-string">&quot;..&quot;</span>
  <span class="ruby-identifier">from</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">to</span>
  <span class="ruby-identifier">from</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">to_file</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">from</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(options, markup = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="Formatter.html"><code>Formatter</code></a></p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-identifier">options</span>, <span class="ruby-identifier">markup</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>

  <span class="ruby-ivar">@markup</span> = <span class="ruby-identifier">markup</span> <span class="ruby-operator">||</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@am</span>     = <span class="ruby-ivar">@markup</span>.<span class="ruby-identifier">attribute_manager</span>
  <span class="ruby-ivar">@am</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/&lt;br&gt;/</span>, <span class="ruby-value">:HARD_BREAK</span>)

  <span class="ruby-ivar">@attributes</span> = <span class="ruby-ivar">@am</span>.<span class="ruby-identifier">attributes</span>

  <span class="ruby-ivar">@attr_tags</span> = []

  <span class="ruby-ivar">@in_tt</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@tt_bit</span> = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">bitmap_for</span> <span class="ruby-value">:TT</span>

  <span class="ruby-ivar">@hard_break</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-ivar">@from_path</span> = <span class="ruby-string">&#39;.&#39;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-accept_document" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_document</span><span
                                class="method-args">(document)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>document</code> to the output</p>

                              <div class="method-source-code" id="accept_document-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 69</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_document</span> <span class="ruby-identifier">document</span>
  <span class="ruby-identifier">document</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">item</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># HACK</span>
      <span class="ruby-identifier">accept_document</span> <span class="ruby-identifier">item</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">accept</span> <span class="ruby-keyword">self</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_regexp_handling_RDOCLINK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_regexp_handling_RDOCLINK</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds a regexp handling for links of the form rdoc-…:</p>

                              <div class="method-source-code" id="add_regexp_handling_RDOCLINK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 83</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_regexp_handling_RDOCLINK</span>
  <span class="ruby-ivar">@markup</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/rdoc-[a-z]+:[^\s\]]+/</span>, <span class="ruby-value">:RDOCLINK</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_regexp_handling_TIDYLINK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_regexp_handling_TIDYLINK</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds a regexp handling for links of the form <a href="<url>“><text></a> and &lt;<a href="<url>”>word></a></p>

                              <div class="method-source-code" id="add_regexp_handling_TIDYLINK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 91</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_regexp_handling_TIDYLINK</span>
  <span class="ruby-ivar">@markup</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/(?:
                                \{.*?\} |    # multi-word label
                                \b[^\s{}]+? # single-word label
                               )

                               \[\S+?\]     # link target
                              /x</span>, <span class="ruby-value">:TIDYLINK</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_tag" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_tag</span><span
                                class="method-args">(name, start, stop)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add a new set of tags for an attribute. We allow separate start and end tags for flexibility</p>

                              <div class="method-source-code" id="add_tag-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 105</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_tag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>)
  <span class="ruby-identifier">attr</span> = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">bitmap_for</span> <span class="ruby-identifier">name</span>
  <span class="ruby-ivar">@attr_tags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">InlineTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attr</span>, <span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate</span><span
                                class="method-args">(tag)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Allows <code>tag</code> to be decorated with additional information.</p>

                              <div class="method-source-code" id="annotate-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate</span>(<span class="ruby-identifier">tag</span>)
  <span class="ruby-identifier">tag</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Marks up <code>content</code></p>

                              <div class="method-source-code" id="convert-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 120</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert</span> <span class="ruby-identifier">content</span>
  <span class="ruby-ivar">@markup</span>.<span class="ruby-identifier">convert</span> <span class="ruby-identifier">content</span>, <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert_flow" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert_flow</span><span
                                class="method-args">(flow)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Converts flow items <code>flow</code></p>

                              <div class="method-source-code" id="convert_flow-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 127</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert_flow</span>(<span class="ruby-identifier">flow</span>)
  <span class="ruby-identifier">res</span> = []

  <span class="ruby-identifier">flow</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">item</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">convert_string</span>(<span class="ruby-identifier">item</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrChanger</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">off_tags</span> <span class="ruby-identifier">res</span>, <span class="ruby-identifier">item</span>
      <span class="ruby-identifier">on_tags</span> <span class="ruby-identifier">res</span>, <span class="ruby-identifier">item</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">RegexpHandling</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">convert_regexp_handling</span>(<span class="ruby-identifier">item</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown flow element: #{item.inspect}&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">res</span>.<span class="ruby-identifier">join</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert_regexp_handling" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert_regexp_handling</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Converts added regexp handlings. See <a href="../Markup.html#method-i-add_regexp_handling"><code>RDoc::Markup#add_regexp_handling</code></a></p>

                              <div class="method-source-code" id="convert_regexp_handling-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 150</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert_regexp_handling</span> <span class="ruby-identifier">target</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">in_tt?</span>

  <span class="ruby-identifier">handled</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">each_name_of</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">type</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;handle_regexp_#{name}&quot;</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">method_name</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span> = <span class="ruby-identifier">public_send</span> <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">target</span>
      <span class="ruby-identifier">handled</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">handled</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">target_name</span> = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">as_string</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">type</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Unhandled regexp handling #{target_name}: #{target}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert_string" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert_string</span><span
                                class="method-args">(string)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Converts a string to be fancier if desired</p>

                              <div class="method-source-code" id="convert_string-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert_string</span> <span class="ruby-identifier">string</span>
  <span class="ruby-identifier">string</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ignore" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ignore</span><span
                                class="method-args">(*node)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Use ignore in your subclass to ignore the content of a node.</p>

<pre class="ruby"><span class="ruby-comment">##</span>
<span class="ruby-comment"># We don&#39;t support raw nodes in ToNoRaw</span>

<span class="ruby-keyword">alias</span> <span class="ruby-identifier">accept_raw</span> <span class="ruby-identifier">ignore</span>
</pre>

                              <div class="method-source-code" id="ignore-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ignore</span> <span class="ruby-operator">*</span><span class="ruby-identifier">node</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-in_tt-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">in_tt?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Are we currently inside tt tags?</p>

                              <div class="method-source-code" id="in_tt-3F-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 194</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">in_tt?</span>
  <span class="ruby-ivar">@in_tt</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-off_tags" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">off_tags</span><span
                                class="method-args">(res, item)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Turns off tags for <code>item</code> on <code>res</code></p>

                              <div class="method-source-code" id="off_tags-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">off_tags</span> <span class="ruby-identifier">res</span>, <span class="ruby-identifier">item</span>
  <span class="ruby-identifier">attr_mask</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">turn_off</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr_mask</span>.<span class="ruby-identifier">zero?</span>

  <span class="ruby-ivar">@attr_tags</span>.<span class="ruby-identifier">reverse_each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr_mask</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">bit</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span>
      <span class="ruby-ivar">@in_tt</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tt?</span> <span class="ruby-identifier">tag</span>
      <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">annotate</span>(<span class="ruby-identifier">tag</span>.<span class="ruby-identifier">off</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_tags" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_tags</span><span
                                class="method-args">(res, item)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Turns on tags for <code>item</code> on <code>res</code></p>

                              <div class="method-source-code" id="on_tags-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 201</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_tags</span> <span class="ruby-identifier">res</span>, <span class="ruby-identifier">item</span>
  <span class="ruby-identifier">attr_mask</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">turn_on</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr_mask</span>.<span class="ruby-identifier">zero?</span>

  <span class="ruby-ivar">@attr_tags</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr_mask</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">bit</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">annotate</span>(<span class="ruby-identifier">tag</span>.<span class="ruby-identifier">on</span>)
      <span class="ruby-ivar">@in_tt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tt?</span> <span class="ruby-identifier">tag</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parse_url" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse_url</span><span
                                class="method-args">(url)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Extracts and a scheme, url and an anchor id from <code>url</code> and returns them.</p>

                              <div class="method-source-code" id="parse_url-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse_url</span> <span class="ruby-identifier">url</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">url</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^rdoc-label:([^:]*)(?::(.*))?/</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">scheme</span> = <span class="ruby-string">&#39;link&#39;</span>
    <span class="ruby-identifier">path</span>   = <span class="ruby-node">&quot;##{$1}&quot;</span>
    <span class="ruby-identifier">id</span>     = <span class="ruby-node">&quot; id=\&quot;#{$2}\&quot;&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-node">$2</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/([A-Za-z]+):(.*)/</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">scheme</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">downcase</span>
    <span class="ruby-identifier">path</span>   = <span class="ruby-node">$2</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^#/</span> <span class="ruby-keyword">then</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">scheme</span> = <span class="ruby-string">&#39;http&#39;</span>
    <span class="ruby-identifier">path</span>   = <span class="ruby-identifier">url</span>
    <span class="ruby-identifier">url</span>    = <span class="ruby-identifier">url</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;link&#39;</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">url</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># is this meaningful?</span>
            <span class="ruby-identifier">path</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">gen_relative_url</span> <span class="ruby-ivar">@from_path</span>, <span class="ruby-identifier">path</span>
          <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  [<span class="ruby-identifier">scheme</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">id</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tt-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tt?</span><span
                                class="method-args">(tag)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Is <code>tag</code> a tt tag?</p>

                              <div class="method-source-code" id="tt-3F-source">
            <pre><span class="ruby-comment"># File rdoc/markup/formatter.rb, line 261</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tt?</span> <span class="ruby-identifier">tag</span>
  <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">bit</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tt_bit</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

